<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>面向对象</title>
	</head>
	<body>
	</body>
	<script>
		function Objectss(name,age,sex,has,sty){
			var obj = new Object();
			obj.name = name;
			obj.age = age;
			obj.sex = sex;
			obj.has = has;
//			obj.sty = function(){
//				document.write("其实我喜欢女的");
//			}
			obj.sty = sty;
			return obj;
		}
		var a = Objectss("小明",18,"男","男朋友","哈哈，其实我喜欢女的");
		alert(`${a.name}今年${a.age}岁 性别:${a.sex}  他是有${a.has}的   但他的${a.has}说: ${a.sty}`)
		
	</script>
</html>
